<table class="lb_block" cellpadding="2" cellspacing="1">
	<tr>
		<td class="lb_block_title">{$smarty.const.LANG_PLUGINS}</td>
	</tr>
	<tr>
		<td class="lb_block_body">
			<br />
			{if $action == "add_plugin"}
				{if $available_plugins == false}
				<b>{$smarty.const.LANG_NO_PLUGIN_TO_INSTALL}</b>
				{else}
					<form action="{$webdir}admin.php?task={$task}&action={$action}" method="post">
					{$smarty.const.LANG_TITLE}<input type="text" name="title" /><br />
					{$smarty.const.LANG_PLUGIN}<select name="plugin">
					{foreach item=item from=$available_plugins}
					<option value="{$item}">{$item}</option>
					{/foreach}
					</select><br />
					{$smarty.const.LANG_PLUGIN_HOOK}<select name="hook">
					{foreach item=item from=$hooks}
					<option value="{$item}">{$item}</option>
					{/foreach}
					</select><br />
					{$smarty.const.LANG_PAGES}<input type="text" name="pages" /><br />
					<input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}" /><br />
					</form>
				{/if}
			{elseif $action == "edit_plugin"}
					<form action="{$webdir}admin.php?task={$task}&action={$action}" method="post">
					{$smarty.const.LANG_TITLE}<input type="text" name="title" value="{$edit_plugin.title}" /><br />
					{$smarty.const.LANG_PLUGIN}: {$edit_plugin.name}<br />
					{$smarty.const.LANG_PLUGIN_HOOK}<select name="hook">
					{foreach item=item from=$hooks}
					<option value="{$item}"{if $item == $edit_plugin.hook} selected{/if}>{$item}</option>
					{/foreach}
					</select><br />
					{$smarty.const.LANG_PAGES}<input type="text" name="pages" value="{$edit_plugin.pages}" /><br />
					<input type="hidden" name="id" value="{$edit_plugin.id}" />
					<input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}" /><br />
					</form>
			{elseif $action == "manage_plugin"}
				<form action="{$webdir}admin.php?task={$task}&action={$action}" method="post">
					<input type="hidden" value="" />
					{include file="$dir/plugin/$plugin_name/templates/edit.tpl"}<br />
					<input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}" />
				</form>
			{else}
			<table border="1" cellpadding="0" cellspacing="1" align="center" width="90%" style="border: 1px solid">
				{foreach item=item key=id from=$installed_plugins}
					<tr>
						<td>{$item.title} </td>
						<td> {$item.name} </td>
						<td> {$item.hook}</td>
						<td>{if $item.pages==''}All{else}{$item.pages}{/if}</td>
						<td><a href="{$webdir}admin.php?task={$task}&action=edit_plugin&id={$id}">{$smarty.const.LANG_EDIT_PLUGIN}</a></td>
						<td><a href="{$webdir}admin.php?task={$task}&action=manage_plugin&id={$id}">{$smarty.const.LANG_MANAGE_PLUGIN}</a></td>
						<td><a href="{$webdir}admin.php?task={$task}&action=remove_plugin&id={$id}&title={$item.title}">{$smarty.const.LANG_REMOVE_PLUGIN}</a></td>
						<td>Up Down</td>
					</tr>
				{/foreach}
			</table>
			<ul>
			<li><a href="{$webdir}admin.php?task={$task}&action=add_plugin">{$smarty.const.LANG_ADD_PLUGIN}</a></li>
			</ul>
			{/if}
		</td>
	</tr>
</table>
<table class="lb_block" cellpadding="2" cellspacing="1">
	<tr>
		<td class="lb_block_title">{$smarty.const.LANG_PLUGIN_HOOKS}</td>
	</tr>
	<tr>
		<td class="lb_block_body">
			<ul>
			{foreach item=item from=$hooks}
			<li>{$item}</li>
			{/foreach}
			</ul>
			<br />
		</td>
	</tr>
</table>
